]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Return a Meta.Rectangle as geometry
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Sat, 13 Jul 2019 00:17:20 +0000 (02:17 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 16 Oct 2019 15:26:13 +0000 (15:26 +0000)
Since the geometry is used as a signal parameter, this can't be used when using
a GObject based class, so use the Meta boxed type instead of a JS object.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559

js/ui/screenshot.js

index 33233db90defbf1f205bf08a94d2cfa159ad0465..bbc1be499c39cb001a5bbf937e30c37484824636 100644 (file)
@@ -264,10 +264,12 @@ var SelectArea = class {
     }
 
     _getGeometry() {
-        return { x: Math.min(this._startX, this._lastX),
-                 y: Math.min(this._startY, this._lastY),
-                 width: Math.abs(this._startX - this._lastX) + 1,
-                 height: Math.abs(this._startY - this._lastY) + 1 };
+        return new Meta.Rectangle({
+            x: Math.min(this._startX, this._lastX),
+            y: Math.min(this._startY, this._lastY),
+            width: Math.abs(this._startX - this._lastX) + 1,
+            height: Math.abs(this._startY - this._lastY) + 1
+        });
     }
 
     _onMotionEvent(actor, event) {